package channelStatus

import "gitee.com/fierce_wolf/go-fox-edge-common/commRedisService"

type channelParam struct {
}

// UpdateParamStatus 更新参数状态
func (e *channelParam) UpdateParamStatus(channelName string, key string, value interface{}) error {
	exist, err := Status.getChannelStatus(channelName)
	if err != nil {
		return err
	}
	if exist == nil {
		return nil
	}
	if exist.ChannelParam == nil {
		exist.ChannelParam = make(map[string]interface{})
	}

	exist.ChannelParam[key] = value
	return commRedisService.UpdateEntity(exist)
}
